Examples de script
Thinking Home marche parfaitement avec AppleScript avec un dictionnaire complet, que vous pouvez parcourir avec un éditeur de script. Ce qui n'est pas visible dans le dictionnaire, c'est que vous pouvez faire référence aux appareils avec des méthodes alternatives. Par exemple, les ordres “turn on” ci-dessous sont tous équivalents.
Voici quelques exemples d'AppleScript dans Thinking Home.
Faire référence à un appareil |
-- Vous pouvez manipuler les appareils comme il vous plait tell application "Thinking Home"
turn on the "Porch Light"
end tellturn on "P16" turn on device "Porch Light" turn on device 3 tell the "Porch Light" of application "Thinking Home"
turn on
end telltell application "Thinking Home"
tell the "Porch Light"
end tell
turn on
end tell |
Diminuer
|
-- Diminuer et augmenter l'intensité des lampes est aussi facile. tell application "Thinking Home"
dim the "Porch Light"-- default is by 35%
end tell
brighten the "Porch Light" by 80 -- percent dim the "Porch Light" to 20 -- percent |
Levé
|
tell application "Thinking Home"
set mySunUp to the sunrise for the current date
end tellset mySundown to the sunset for the current date |